"""
This module contains the class for the character Roy. Modifications to
his object should be done here.
"""

import pygame, math
from pygame.locals import *
from qnd import *

SPEED = 5

#### PARENT CLASS ####
#Don't mess with this code
class Item:
	"""
	The parent class for an item. Extend this class 
	"""
	def __init__(self,*args,**kwargs):
		"""Do not override this class"""
		self.name = 'None'                         #the name of the item
		self.icon = load_image('icon_default.png') #the image to display in the inventory screen
		self.value = 0                             #the monetary value of the item
		self.owner = None                          #the owner of the
		
		self.init(*args,**kwargs) #call the custom init function
	def init(self):
		"""Override this method to add custom initiation code for your item."""
		pass
	def use(self, character):
		"""Called when the character uses the item."""
		pass
	def destroy(self,character):
		"""Called to destroy the item completely."""
		character.inventory.remove(self)


#### SUB CLASSES ####
#this is where you can make your own items. You can use the health
#potion as a template.

##POTIONS##
class HealthPotion(Item):
	"""A health potion that heals the user and destroys itself when used."""
	def init(self):
		self.name = 'Health Potion'
		self.icon = load_image('icon_health_potion.png')
		self.value = 50
		self.healing_power = 30 #the number of hitpoints the potion can heal
	def use(self, character):
		"""Called when the character uses the item."""
		character.health += self.healing_power
		self.destroy(character)
